diff options
| author | Adam Soltys <[email protected]> | 2024-10-31 09:34:16 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-10-31 09:34:16 -0700 |
| commit | 243abb0a3d29e8e34e263eec843488e3bdb468a4 (patch) | |
| tree | be55931ba0f3c110c3001f56a5339cb63e78b761 /src/routes/(app)/fund/[id]/withdraw | |
| parent | 4742e72ec25823ceeea7848fb2e1f868bed7f472 (diff) | |
| download | coinos-ui-243abb0a3d29e8e34e263eec843488e3bdb468a4.tar.gz coinos-ui-243abb0a3d29e8e34e263eec843488e3bdb468a4.zip | |
biome
Diffstat (limited to 'src/routes/(app)/fund/[id]/withdraw')
| -rw-r--r-- | src/routes/(app)/fund/[id]/withdraw/+page.server.ts | 22 | ||||
| -rw-r--r-- | src/routes/(app)/fund/[id]/withdraw/+server.ts | 2 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/routes/(app)/fund/[id]/withdraw/+page.server.ts b/src/routes/(app)/fund/[id]/withdraw/+page.server.ts index f0379153..1e477918 100644 --- a/src/routes/(app)/fund/[id]/withdraw/+page.server.ts +++ b/src/routes/(app)/fund/[id]/withdraw/+page.server.ts @@ -2,19 +2,19 @@ import { fail, redirect } from "@sveltejs/kit"; import { fd, auth, post } from "$lib/utils"; export async function load({ parent }) { - let { user } = await parent(); - if (!user) redirect(307, "/register"); + const { user } = await parent(); + if (!user) redirect(307, "/register"); } export const actions = { - default: async ({ cookies, request }) => { - let body = await fd(request); - try { - await post("/take", body, auth(cookies)); - } catch (e: any) { - return fail(400, { message: e.message }); - } + default: async ({ cookies, request }) => { + const body = await fd(request); + try { + await post("/take", body, auth(cookies)); + } catch (e: any) { + return fail(400, { message: e.message }); + } - redirect(307, `/fund/${body.id}`); - }, + redirect(307, `/fund/${body.id}`); + }, }; diff --git a/src/routes/(app)/fund/[id]/withdraw/+server.ts b/src/routes/(app)/fund/[id]/withdraw/+server.ts index 96d66413..dabef6f8 100644 --- a/src/routes/(app)/fund/[id]/withdraw/+server.ts +++ b/src/routes/(app)/fund/[id]/withdraw/+server.ts @@ -2,5 +2,5 @@ import { json } from "@sveltejs/kit"; import { auth, post } from "$lib/utils"; export async function POST({ cookies, request }) { - return json(await post("/take", await request.json(), auth(cookies))); + return json(await post("/take", await request.json(), auth(cookies))); } |
